import de.ruedigermoeller.fastcast.bigtest.DataMutatingClient;
import de.ruedigermoeller.fastcast.service.fcdemon.FCDemon;
import de.ruedigermoeller.fastcast.service.fcdemon.FCStartScript;

import java.lang.Exception;
import java.lang.Integer;
import java.util.List;

/**
 * fcon -j BigTest
 * can be changed without recompile. No Generics support (janino)
 */
public class Mutator extends FCStartScript {

    @Override
    public void startCluster(String arg, List demons) {
        try {
            int count  = 1;
            try {
                count = Integer.parseInt(arg);
            } catch (Exception e) {
                //e.printStackTrace();
            }
            for ( int i = 0; i < count; i++) {
                System.out.println("Starting node "+DataMutatingClient.class.getName()+"-"+i);
                FCDemon.ProcessEntry en = startNode("-Xms2g -Xmx2g",DataMutatingClient.class, arg);
                if ( en == null ) {
                    System.out.println("   failed");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}